<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>课程管理</title>
</head>
<link rel="stylesheet" href="__STATIC__/admin/js/layer/theme/default/layer.css">
<link rel="stylesheet" href="__STATIC__/admin/js/layui/css/layui.css">
<link rel="stylesheet" href="__STATIC__/admin/css/coursesCommon.css">
<link rel="stylesheet" href="__STATIC__/admin/js/jqzoom/jqzoom.css">
<link href="__STATIC__/admin/js/bootstrap/css/bootstrap.css"
      rel="stylesheet">
<link href="__STATIC__/admin/css/AdminLTE.css" rel="stylesheet"
      type="text/css" />
<body>
<table class="table table-hover">
    <tr class="tr_1">
        <th>ID</th>
        <th>课程名字</th>
        <th>课程标题</th>
        <th>上传者名字</th>
        <th>封面图片</th>
        <th>课程金额</th>
        <th>状态</th>
        <th>课程创建时间</th>
        <th>操作</th>
    </tr>
    {volist name="courses" id="v"}
    <tr>
        <td>{$v.courses_id}</td>
        <td>{$v.courses_name}</td>
        <td>{$v.courses_title}</td>
        <td>{$v.user_name}</td>
        <td class="zoomImg" >
            <img src="{$v.courses_photo}" width="150px" height="100px" alt="图片" jqimg='{$v.courses_photo}' >
        </td>
        <td>{$v.courses_money}</td>
        <td>{if condition="$v.courses_del eq '2'"}
            <span class='label label-danger wst-label'> 待审核 </span>
            {/if}
        </td>
        <td>{$v.courses_time|date="Y-m-d H:i:s",###}</td>
        <td>
            <a href="{:url('admin/examine/uservideo')}?id={$v.user_id}">
                <button type="button" class="btn btn-primary">上传者的其他视频</button>
            </a>
            <button type="button" class="btn3 btn btn-success" data-id="{$v.courses_id}">通过</button>
            <button type="button" class="btn2 btn btn-warning" data-id="{$v.courses_id}">退回</button>
        </td>
    </tr>
    {/volist}
</table>
<script src="__STATIC__/admin/js/jquery.min.js"></script>
<script src="__STATIC__/admin/js/layer/layer.js"></script>
<script src="__STATIC__/admin/js/layui/layui.js"></script>
<script src="__STATIC__/admin/js/jqzoom/jqzoom.js"></script>
</body>

<script>
    $(document).ready(function(){
        $(".btn2").click(function (){
            var link = $(this);
            var id = link.attr("data-id");
            var cid = link.attr("data-cid");
            if(cid == 2){
                layer.msg('文件已经退回，请不要重复操作');
                return false;
            }
            $.get("{:url('admin/examine/isEae')}?id="+id+"&code=1",function(data){
                console.log(data)
                if(data == 1){
                    layer.msg('退回成功');
                    setTimeout(function(){window.location.reload();},3000);
                }else{
                    layer.msg('退回失败,请检查文件内容');
                    setTimeout(function(){window.location.reload();},3000);
                }
            });
        });
    });

    <!--文件通过 -->
    $(document).ready(function(){
        $(".btn3").click(function (){
            var link = $(this);
            var id = link.attr("data-id");
            var cid = link.attr("data-cid");
            if(cid == 0){
                layer.msg('文件已经审核，请不要重复操作');
                return false;
            }
            $.get("{:url('admin/examine/isEae')}?id="+id+"&code=2",function(data){
                console.log(data)
                if(data == 1){
                    layer.msg('审核成功');
                    setTimeout(function(){window.location.reload();},3000);
                }else{
                    layer.msg('审核失败,请检查文件内容');
                    setTimeout(function(){window.location.reload();},3000);
                }
            });
        });
    });
</script>
</html>